{% extends 'base.html' %}
{% block content %}
<div class="card mx-auto" style="max-width:600px;">
    <div class="row g-0">
        <div class="col-md-4 d-flex align-items-center justify-content-center">
            {% if book.cover %}
                <img src="{{ book.cover.url }}" alt="封面" class="img-fluid rounded-start" style="max-width:160px;max-height:220px;">
            {% else %}
                <span class="text-muted">无封面</span>
            {% endif %}
        </div>
        <div class="col-md-8">
            <div class="card-body">
                <h1 class="card-title">{{ book.title }}</h1>
                <p><strong>作者：</strong>{{ book.author.name }}</p>
                <p><strong>出版日期：</strong>{{ book.published_date }}</p>
                <p><strong>ISBN：</strong>{{ book.isbn }}</p>
                <p><strong>简介：</strong>{{ book.summary }}</p>
                <div class="mt-3">
                    <a href="{% url 'book-list' %}" class="btn btn-secondary">返回列表</a>
                    <a href="{% url 'book-edit' book.pk %}" class="btn btn-info">编辑</a>
                    <a href="{% url 'book-delete' book.pk %}" class="btn btn-danger">删除</a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 